]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
PlacesManager: fix .gtk-bookmarks monitor scope
authorStefan 'psYchotic' Zwanenburg <stefanhetzwaantje@gmail.com>
Sun, 16 Oct 2011 16:30:13 +0000 (18:30 +0200)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 18 Oct 2011 18:03:36 +0000 (14:03 -0400)
The GFileMonitor on ~/.gtk-bookmarks was block-scoped in the
PlacesManager._init() function, which caused it to be destroyed as soon
as the constructor was done. This caused changes in bookmarks to never
be notified to possible watchers (such as the places-menu extension).
To fix this, the 'monitor' variable has been promoted to an object
instance member.

https://bugzilla.gnome.org/show_bug.cgi?id=661921

js/ui/placeDisplay.js

index 4864f2c7bf6b245483f05920bbeea203476e5338..19f823fff48291b3839c340bb1cf4ded25d41e92 100644 (file)
@@ -195,9 +195,9 @@ PlacesManager.prototype = {
 
         this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']);
         this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath);
-        let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
+        this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
         this._bookmarkTimeoutId = 0;
-        monitor.connect('changed', Lang.bind(this, function () {
+        this._monitor.connect('changed', Lang.bind(this, function () {
             if (this._bookmarkTimeoutId > 0)
                 return;
             /* Defensive event compression */